<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickshape.cpp -->
  <title>RadialGradient QML 类型 | Qt Quick 5.12.3</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.12</a></td><td ><a href="qtquick-index.html">Qt Quick 模块</a></td><td ><a href="qtquick-qmlmodule.html">QML类型</a></td><td >RadialGradient QML 类型</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtquick-index.html">Qt 5.12.3 参考指南</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">目录</a></h3>
<ul>
<li class="level1"><a href="#properties">属性</a></li>
<li class="level1"><a href="#details">详细信息</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">RadialGradient QML 类型</h1>
<span class="subtitle"></span>
<!-- $$$RadialGradient-brief -->
<p>Radial gradient. <a href="#details">更多...</a></p>
<!-- @@@RadialGradient -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> 导入语句：</td><td class="memItemRight bottomAlign"> import QtQuick.Shapes 1.12</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 5.10</td></tr><tr><td class="memItemLeft rightAlign topAlign">继承自：</td><td class="memItemRight bottomAlign"> <p><a href="qml-qtquick-shapes-shapegradient.html">ShapeGradient</a></p>
</td></tr></table></div><ul>
<li><a href="qml-qtquick-shapes-radialgradient-members.html">所有成员的列表，包括继承成员</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">属性</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-shapes-radialgradient.html#centerRadius-prop">centerRadius</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-shapes-radialgradient.html#centerX-prop">centerX</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-shapes-radialgradient.html#centerY-prop">centerY</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-shapes-radialgradient.html#focalRadius-prop">focalRadius</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-shapes-radialgradient.html#focalX-prop">focalX</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-shapes-radialgradient.html#focalY-prop">focalY</a></b></b> : real</li>
</ul>
<!-- $$$RadialGradient-description -->
<a name="details"></a>
<h2 id="details">详细信息</h2>
<p>Radial gradients interpolate colors between a focal circle and a center circle in Shape items. Points outside the cone defined by the two circles will be transparent.</p>
<p>Outside the end points the gradient is either padded, reflected or repeated depending on the spread type.</p>
<p>Below is an example of a simple radial gradient. Here the colors are interpolated between the specified point and the end points on a circle specified by the radius:</p>
<pre class="cpp">

  fillGradient: RadialGradient {
      centerX: <span class="number">50</span>; centerY: <span class="number">50</span>
      centerRadius: <span class="number">100</span>
      focalX: centerX; focalY: centerY
      GradientStop { position: <span class="number">0</span>; color: <span class="string">&quot;blue&quot;</span> }
      GradientStop { position: <span class="number">0.2</span>; color: <span class="string">&quot;green&quot;</span> }
      GradientStop { position: <span class="number">0.4</span>; color: <span class="string">&quot;red&quot;</span> }
      GradientStop { position: <span class="number">0.6</span>; color: <span class="string">&quot;yellow&quot;</span> }
      GradientStop { position: <span class="number">1</span>; color: <span class="string">&quot;cyan&quot;</span> }
  }

</pre>
<p class="centerAlign"><img src="images/shape-radial-gradient.png" alt="" /></p><p>Extended radial gradients, where a separate focal circle is specified, are also supported.</p>
<p><b>Note: </b><a href="qml-qtquick-shapes-radialgradient.html">RadialGradient</a> is only supported in combination with Shape items. It is not compatible with <a href="qml-qtquick-rectangle.html">Rectangle</a>, as that only supports <a href="qml-qtquick-gradient.html">Gradient</a>.</p><p><b>See also </b><a href="../qtgui/qradialgradient.html">QRadialGradient</a>.</p>
<!-- @@@RadialGradient -->
<h2>属性文档</h2>
<!-- $$$centerRadius -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="centerRadius-prop">
<td class="tblQmlPropNode"><p>
<a name="centerRadius-prop"></a><span class="name">centerRadius</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties define the center and focal radius. For simple radial gradients, <a href="qml-qtquick-shapes-radialgradient.html#focalRadius-prop">focalRadius</a> should be set to <code>0</code> (the default value).</p>
</div></div><!-- @@@centerRadius -->
<br/>
<!-- $$$centerX -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="centerX-prop">
<td class="tblQmlPropNode"><p>
<a name="centerX-prop"></a><span class="name">centerX</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties define the center and focal points. To specify a simple radial gradient, set <a href="qml-qtquick-shapes-radialgradient.html#focalX-prop">focalX</a> and <a href="qml-qtquick-shapes-radialgradient.html#focalY-prop">focalY</a> to the value of centerX and <a href="qml-qtquick-shapes-radialgradient.html#centerY-prop">centerY</a>, respectively.</p>
</div></div><!-- @@@centerX -->
<br/>
<!-- $$$centerY -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="centerY-prop">
<td class="tblQmlPropNode"><p>
<a name="centerY-prop"></a><span class="name">centerY</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties define the center and focal points. To specify a simple radial gradient, set <a href="qml-qtquick-shapes-radialgradient.html#focalX-prop">focalX</a> and <a href="qml-qtquick-shapes-radialgradient.html#focalY-prop">focalY</a> to the value of <a href="qml-qtquick-shapes-radialgradient.html#centerX-prop">centerX</a> and centerY, respectively.</p>
</div></div><!-- @@@centerY -->
<br/>
<!-- $$$focalRadius -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="focalRadius-prop">
<td class="tblQmlPropNode"><p>
<a name="focalRadius-prop"></a><span class="name">focalRadius</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties define the center and focal radius. For simple radial gradients, focalRadius should be set to <code>0</code> (the default value).</p>
</div></div><!-- @@@focalRadius -->
<br/>
<!-- $$$focalX -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="focalX-prop">
<td class="tblQmlPropNode"><p>
<a name="focalX-prop"></a><span class="name">focalX</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties define the center and focal points. To specify a simple radial gradient, set focalX and <a href="qml-qtquick-shapes-radialgradient.html#focalY-prop">focalY</a> to the value of <a href="qml-qtquick-shapes-radialgradient.html#centerX-prop">centerX</a> and <a href="qml-qtquick-shapes-radialgradient.html#centerY-prop">centerY</a>, respectively.</p>
</div></div><!-- @@@focalX -->
<br/>
<!-- $$$focalY -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="focalY-prop">
<td class="tblQmlPropNode"><p>
<a name="focalY-prop"></a><span class="name">focalY</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>These properties define the center and focal points. To specify a simple radial gradient, set <a href="qml-qtquick-shapes-radialgradient.html#focalX-prop">focalX</a> and focalY to the value of <a href="qml-qtquick-shapes-radialgradient.html#centerX-prop">centerX</a> and <a href="qml-qtquick-shapes-radialgradient.html#centerY-prop">centerY</a>, respectively.</p>
</div></div><!-- @@@focalY -->
<br/>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
